@namespace RazorConsole.Components

<div @onfocus="OnFocus" @onfocusout="OnFocusOut" @onclick="OnClick">
	<Markup Content="@Content" Background="@(isFocused ? FocusedColor : BackgroundColor)" />
</div>

@code {
	private bool isFocused = false;
    [Parameter]
    public Spectre.Console.Color FocusedColor { get; set; } = Spectre.Console.Color.Yellow;

    [Parameter]
    public Spectre.Console.Color BackgroundColor { get; set; } = Spectre.Console.Color.Default;

    [Parameter]
    public string Content { get; set; } = string.Empty;

    [Parameter]
    public EventCallback OnClick { get; set; }

    private void OnFocus(FocusEventArgs e)
    {
		isFocused = true;
        StateHasChanged();
    }

    private void OnFocusOut(FocusEventArgs e)
    {
		isFocused = false;
        StateHasChanged();
    }
}
